local suiyu = fk.CreateSkill{
  name = "dajubei__suiyu"
}

Fk:loadTranslationTable{
  ["dajubei__suiyu"] = "绥御",
  [":dajubei__suiyu"] = "你的回合外，当目标为你的牌结算后，你可令使用者摸一张牌并交给你一张牌。",

  ["#dajubei__suiyu-ivk"] = "绥御：可以令 %src 摸一张牌并交给你一张牌",
  ["#dajubei__suiyu-give"] = "绥御：请交给 %src 一张牌",

  ["$dajubei__suiyu1"] = "以德怀柔，广得军心。",
  ["$dajubei__suiyu2"] = "德彰四海，威震八荒。",
}

suiyu:addEffect(fk.CardUseFinished, {
  anim_type = "drawcard",
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill("dajubei__suiyu") and data:hasTarget(player)
    and data.from and player ~= player.room.current
  end,
  on_cost = function (self, event, target, player, data)
    return player.room:askToSkillInvoke(player, {
      skill_name = "dajubei__suiyu",
      prompt = "#dajubei__suiyu-ivk:"..data.from.id
    })
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    data.from:drawCards(1, "dajubei__suiyu")

    if player.dead or data.from.dead then return end
    local cards = room:askToCards(data.from, {
      skill_name = "dajubei__suiyu",
      min_num = 1,
      max_num = 1,
      prompt = "#dajubei__suiyu-give:"..player.id,
      include_equip = true,
      cancelable = false,
    })

    if #cards == 1 then
      room:obtainCard(player,cards, false, fk.ReasonGive, data.from, "dajubei__suiyu", nil, {player.id})
    end
  end
})

return suiyu